package hrm.action.login;

import hrm.action.Action;
import hrm.action.ActionForward;
import hrm.dto.insa.EmployeeDTO;
import hrm.serviceimple.EmployeeServiceImple;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ListLogin implements Action {

	@SuppressWarnings("unchecked")
	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
		// TODO Auto-generated method stub
		ActionForward actfoward = new ActionForward();
		EmployeeServiceImple employeeService = EmployeeServiceImple.getInstance();
		String namekor = request.getParameter("namekor");
		EmployeeDTO dto = new EmployeeDTO();
		dto.setNamekor(namekor);
		List<EmployeeDTO> employeeList = employeeService.getAllEmployee(dto);
		request.setAttribute("employeeList", employeeList);
		actfoward.setUrl("loginList");
		return actfoward;
	}
}
